package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.TravelConcern;
import cn.wolfcode.trip.base.query.TravelConcernQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TravelConcernMapper {
    int deleteByPrimaryKey(Long id);

    int insert(TravelConcern record);

    TravelConcern selectByPrimaryKey(Long id);

    List<TravelConcern> selectAll();

    int updateByPrimaryKey(TravelConcern record);

    List<TravelConcern> selectByTravelId(TravelConcernQueryObject qo);

    void updateIsViewed(List<Long> userId);

    int selectByTravelIdLike(List<Long> travelIds);

    int getLikeNumsByTravelId(Long travelId);

    int getcollectorNumsByTravelId(Long travelId);

    TravelConcern checkUserTravelConcerns(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void updateLikerByPrimaryKey(TravelConcern travelConcern);

    //注意这里传递点赞者的id 但SQL执行的是收藏者的id
    TravelConcern checkCollectorTravelConcerns(@Param("userId") Long userId, @Param("travelId") Long travelId);

    List<TravelConcern> searchNull();

    TravelConcern checkUserConcernCollector(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void updateCollectorByPrimaryKey(TravelConcern travelConcern);
}